package tushare

import (
	"tushare/model/mysql"
)

type DailyMin struct {
	Id         int64   `json:"id"`
	TsCode     string  `json:"ts_code"`
	Min        float64 `json:"min"`
	LimitDays  int64   `json:"limit_days"`
	CreateDate string  `json:"create_date"`
}

func DailyMinCreate(dm DailyMin) {
	mysql.DB.Table("tushare_daily_min").Create(&dm)
}

func DailyMinList(limit int64) []DailyMin {
	dm := []DailyMin{}
	mysql.DB.Table("tushare_daily_min").Where("limit_days = ?", limit).Order("min asc").Scan(&dm)
	return dm
}
